<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮出</title>
    <style>
        .box1 {
            width: 200px;
            height: 300px;
            background-color: #bfa;
            float: left;
            margin: 0 10px;
            transition: all .3s;
        }
        .box2 {
            width: 200px;
            height: 300px;
            background-color: skyblue;
            float: left;
            margin: 0 10px;
            transition: all .3s;
        }
        .box1:hover,.box2:hover {
            transform: translateY(-4px);
            box-shadow: 0 0 10px rgba(0, 0, 0, .3);
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>